﻿using Kw.Combinatorics;
using System;

namespace Kw.CombinatoricsExamples
{
    class ProductExample05
    {
        static void Main ()
        {
            int[] ranges = new int[] { 3, 4, 5 };
            long rank = 34;

            Product pt = new Product (new int[] { 3, 4, 5 }, rank);

            // Elements may be accessed using the default iterator:

            foreach (int element in pt)
                Console.Write ((char) ('A' + element));

            Console.WriteLine ("\n");

            // Elements may be accessed using the index operator:

            for (int i = 0; i < pt.Width; ++i)
                Console.WriteLine ("Element at {0} is {1}", i, pt[i]);
        }

        /* Output:

        BCE

        Element at 0 is 1
        Element at 1 is 2
        Element at 2 is 4

        */
    }
}
